<template>
    <div>
        <div class="tree-box">
            <div class="item" v-for="(item,index) in data" :key='index'>
                <div class="flex">
                    <div class="img-box">
                        <img src="@/assets/img/common/xiangxia.png" alt="" v-if="item.child">
                    </div>
                    <CheckBox :min='true' :is_show='item.state' v-on:change="onChange(item)"/>
                    <p>{{item.name}}</p>
                </div>
                <div class="item" v-if='item.child'>
                    <div class="flex">
                        <div class="img-box">
                            <img src="@/assets/img/common/xiangxia.png" alt="">
                        </div>
                        <CheckBox :min='true' v-on:change="onChange"/>
                        <p>总经办</p>
                    </div>
                </div>
                <div class="item" v-if='item.child'>
                    <div class="flex">
                        <div class="img-box">
                            <img src="@/assets/img/common/xiangxia.png" class="active_img" alt="">
                        </div>
                        <CheckBox :min='true' v-on:change="onChange"/>
                        <p>总经办</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
import CheckBox from "./checkbox";
export default {
    components: {
        CheckBox
    },
    data () {
        return {
            //  is_remember:false
        }
    },
    props: {
        data:{
            type: Array
        }
    },
    methods: {
      // 是否勾选记住密码
      onChange(e){
          this.$emit('change',e);
      }
    }
}
</script>
<style lang="less" scoped>
@import url(../../assets/css/common/tree.less);
</style>


